<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>sql:setDataSource标签示例</title>
</head>
<body>
	<sql:setDataSource var="mytestdb" driver="com.mysql.jdbc.Driver"
		url="jdbc:mysql://localhost/testdb?useSSL=false&characterEncoding=utf8"
		user="root" password="123456" />
	<sql:query dataSource="${mytestdb}" sql="SELECT * FROM `employees`"
		var="result" />
	<!-- // 读取并打印查询员工信息 -->
	<c:forEach var="row" items="${result.rows}">
		<c:out value="${row.id}" /> - <c:out value="${row.name}" /><br/>
	</c:forEach>
</body>
</html>